function sortByGrade(names,grades)
    table.sort(names,function(n1,n2) 
        return grades[n1] > grades[n2]
    end)
end
function newCounter()
    local count = 0
    return function() 
        count = count + 1
        return count -- 逃逸escape 局部变量逃出该变量域
    end
end
c1 = newCounter()
print(c1())
print(c1())
-- function digitButton(digit)
--     return Button{
--         label = tostring(digit),
--         action = function()

--         end
--     }
-- end
do
    local oldSin = math.sin
    local k = math.pi / 180
    math.sin = function (x) 
        return oldSin(x * k)
    end
    -- math.sin = math.cos
end
-- sin仍为cos
-- print(math.sin(1))
